Repository navigation
perf(b12x/comm/roce): raise ring mailbox window to 16 and drain relays eagerly - #157
Open
fordbmorris wants to merge 1 commit into
Open
fordbmorris wants to merge 1 commit into
fordbmorris wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
fordbmorris
force-pushed
the
pr/roce-proxy-window16-eager-drain
branch
from
November 28, 2026 19:42
1a4f0af to
5237366
Compare
…ndshake, and drain eagerly On a four-node switchless 200 Gb/s ConnectX-7 RoCE ring, RING_WINDOW=8 (512 KiB in flight per origin and rail) saturates below the two-hop relay bandwidth-delay product during large prefill collectives, and run_pipe_op deferred drain_all(c) while actively posting chunks, delaying relay forwarding on intermediate ranks. Raising RING_WINDOW without a connect-time check would let mixed-build ranks compute mismatched remote mailbox and ACK offsets, while retaining the previous send-queue cap (ROCE_SEND_DEPTH / 4) would leave insufficient headroom for up to 256 unreserved per-origin ACKs at world=16. Changes in flashinfer/experimental/b12x/comm/roce/_roce_proxy.c: - Raise RING_WINDOW from 8 to 16 (1 MiB in flight per origin and rail; 2.008 MiB per rank in the group, 8.03 MiB/rank at world=4). - Append uint32_t ring_window and uint64_t ring_bytes to roce_blob_t (growing sizeof(roce_blob_t) from 1168 to 1176 bytes while keeping ROCE_ABI_VERSION=14 unchanged so previously exported cores stay compatible). Populate both fields in roce_local_blob (0 in mesh mode) and reject any mismatch in roce_connect. - Tighten the send-queue reservation threshold in reserve() and ring_service_slot() to ROCE_SEND_DEPTH / 8 (64 signaled ops, at most 192 chained WRs, leaving 256 WRs for unreserved per-origin ACKs at world=16 plus 64 WRs of provider SQE overhead) and enforce this bound with a compile-time _Static_assert. - Call drain_all(c) inside run_pipe_op when posted is nonzero and c->ring is active; non-ring transports (c->ring == NULL) are unchanged. - Add test_ring_blob_handshake_rejects_window_and_size_mismatch in tests/experimental/b12x/comm/test_roce_proxy.py covering ABI 14 retention, 1176-byte blob sizing, legacy 1168-byte blob rejection, and live-HCA roce_connect rejection of mismatched ring_window and ring_bytes. Measured effect on four DGX Spark GB10 nodes over 200 Gb/s ConnectX-7 (--roce-ring, H=4608 BF16): ReduceScatter drops 7.1% at M=8192 (3.487 to 3.239 ms, 17.48 GB/s bus BW) and 7.4%-9.7% at M=2048..4096; GatherShards at M=8192 drops 6.2% (3.491 to 3.275 ms); Twoshot at M=8192 drops 6.6% (6.889 to 6.435 ms). One-shot decode latency (M=1..24) is unchanged (19.7-66.8 us). Validation on four NVIDIA GB10 (ARM64) nodes: - pytest -v tests/experimental/b12x/comm/test_roce_proxy.py: 21/21 passed on dgx2 with live ConnectX-7 HCA verification of window/size mismatch rejection. - validate_roce_ring_native.py --world-size 4 --iterations 120 --skew-rank 2 --scatter-gather (ring) and --iterations 60 --ring-open (chain): all four ranks passed with 0/16 ConnectX-7 RDMA port errors. - Rings larger than four nodes were not benchmarked on hardware; world=16 send-queue headroom is enforced statically. Signed-off-by: woooflet <ford@fordmorris.com>
fordbmorris
force-pushed
the
pr/roce-proxy-window16-eager-drain
branch
from
November 30, 2026 00:38
5237366 to
b46125c
Compare
Author
|
Updated and rebased onto current
|
fordbmorris
pushed a commit
to fordbmorris/hyperflare-inference
that referenced
this pull request
Nov 30, 2026
…nd drain relays eagerly On a four-node switchless 200 Gb/s ConnectX-7 --roce-ring, RING_WINDOW=8 (512 KiB in flight per origin and rail) sat below the two-hop relay bandwidth-delay product during large prefill collectives, and run_pipe_op deferred drain_all(c) while actively posting chunks, delaying relay forwarding on intermediate ranks. Because RING_WINDOW determines remote mailbox and ACK offsets (ring_slot and ring_ack_offset), mixed-build ranks with different window sizes would otherwise connect and write to mismatched remote RDMA addresses, and keeping ROCE_SEND_DEPTH / 6 (or / 4 in ring_service_slot) would not leave enough QP send-queue headroom for 256 unreserved per-origin ACKs at world=16 with RING_WINDOW=16. Exact changes (in lockstep with local-inference-lab/flashinfer#157, which must merge before this vendored update): - helios/native/roce_proxy.c: - Raise RING_WINDOW from 8 to 16 (1 MiB in flight per origin and rail; 2.008 MiB per rank in the group, 8.03 MiB/rank at world=4, 32.13 MiB at world=16). - Append uint32_t ring_window and uint64_t ring_bytes to roce_blob_t (growing sizeof(roce_blob_t) from 1168 to 1176 bytes) while keeping ROCE_ABI_VERSION=14 unchanged so previously exported model cores load and serve without re-export. Populate both fields in roce_local_blob (0 in mesh mode) and validate exact agreement in roce_connect. - Tighten reserve() and ring_service_slot() to ROCE_SEND_DEPTH / 8 (64 signaled ops, at most 192 chained WRs, leaving room for up to 256 unreserved per-origin ACKs at world=16 plus 64 WRs of provider SQE overhead), guarded by a compile-time _Static_assert. - Call drain_all(c) inside run_pipe_op when posted is nonzero and c->ring is active. Non-ring transports (c->ring == NULL) are unaffected. - helios/src/execution/roce.rs: assert roce_blob_bytes() == 1176 and verify peer_blobs rejects legacy 1168-byte peer records alongside foreign ABI and truncated records. - docs/roce-ring.md: update documented ring host-memory sizing (2.008 MiB per rank, 8.03 MiB at 4 ranks, 32.13 MiB at 16 ranks) and 16-packet in-flight window. Measured benefit on four DGX Spark GB10 nodes over 200 Gb/s ConnectX-7 (--roce-ring, H=4608 BF16): ReduceScatter drops 7.1% at M=8192 (3.487 to 3.239 ms, 17.48 GB/s bus BW) and 7.4%-9.7% at M=2048..4096; GatherShards at M=8192 drops 6.2% (3.491 to 3.275 ms); Twoshot at M=8192 drops 6.6% (6.889 to 6.435 ms, 98.6% of 200 Gb/s line rate). One-shot decode latency (M=1..24) is unchanged (19.7-66.8 us). Validation and limitations: - ARM64 Linux (dgx2): cargo test --locked --release --manifest-path helios/Cargo.toml --features roce,runtime-core,server passed 1,728/1,728 (44 GPU-only ignored), including all 6 execution::roce::tests. - Paired FlashInfer validator on four GB10 Sparks: pytest tests/experimental/b12x/comm/test_roce_proxy.py passed 21/21 (including live ConnectX-7 HCA rejection of legacy 1168-byte blobs, mismatched ring_window, and mismatched ring_bytes); validate_roce_ring_native.py passed across all four ranks in both ring mode (120 iterations, --skew-rank 2 --scatter-gather) and chain mode (60 iterations, --ring-open --scatter-gather). - Live four-Spark multi-GPU serving via flare run on existing ABI-14 Inkling 2 Small NVFP4 core gb10-tp4-202611271425 (without re-export) passed short decode (60.3 tok/s), 256-token coding decode (80.6 tok/s), and 9,229-token multi-chunk cold prefill + 64-token decode (3.529 s wall) with 0/16 ConnectX-7 RDMA port errors and clean Orbit drain. - Limitations: hardware validation covers a four-node GB10 switchless ring and chain only; rings larger than four nodes were not tested on hardware, and non-ring transports are unchanged. Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b Signed-off-by: woooflet <ford@fordmorris.com>
fordbmorris
pushed a commit
to fordbmorris/hyperflare-inference
that referenced
this pull request
Nov 30, 2026
…nd drain relays eagerly On a four-node switchless 200 Gb/s ConnectX-7 --roce-ring, RING_WINDOW=8 (512 KiB in flight per origin and rail) sat below the two-hop relay bandwidth-delay product during large prefill collectives, and run_pipe_op deferred drain_all(c) while actively posting chunks, delaying relay forwarding on intermediate ranks. Because RING_WINDOW determines remote mailbox and ACK offsets (ring_slot and ring_ack_offset), mixed-build ranks with different window sizes would otherwise connect and write to mismatched remote RDMA addresses, and keeping ROCE_SEND_DEPTH / 6 (or / 4 in ring_service_slot) would not leave enough QP send-queue headroom for 256 unreserved per-origin ACKs at world=16 with RING_WINDOW=16. Exact changes (in lockstep with local-inference-lab/flashinfer#157, which must merge before this vendored update): - helios/native/roce_proxy.c: - Raise RING_WINDOW from 8 to 16 (1 MiB in flight per origin and rail; 2.008 MiB per rank in the group, 8.03 MiB/rank at world=4, 32.13 MiB at world=16). - Append uint32_t ring_window and uint64_t ring_bytes to roce_blob_t (growing sizeof(roce_blob_t) from 1168 to 1176 bytes) while keeping ROCE_ABI_VERSION=14 unchanged so previously exported model cores load and serve without re-export. Populate both fields in roce_local_blob (0 in mesh mode) and validate exact agreement in roce_connect. - Tighten reserve() and ring_service_slot() to ROCE_SEND_DEPTH / 8 (64 signaled ops, at most 192 chained WRs, leaving room for up to 256 unreserved per-origin ACKs at world=16 plus 64 WRs of provider SQE overhead), guarded by a compile-time _Static_assert. - Call drain_all(c) inside run_pipe_op when posted is nonzero and c->ring is active. Non-ring transports (c->ring == NULL) are unaffected. - helios/src/execution/roce.rs: assert roce_blob_bytes() == 1176 and verify peer_blobs rejects legacy 1168-byte peer records alongside foreign ABI and truncated records. - docs/roce-ring.md: update documented ring host-memory sizing (2.008 MiB per rank, 8.03 MiB at 4 ranks, 32.13 MiB at 16 ranks) and 16-packet in-flight window. Measured benefit on four DGX Spark GB10 nodes over 200 Gb/s ConnectX-7 (--roce-ring, H=4608 BF16): ReduceScatter drops 7.1% at M=8192 (3.487 to 3.239 ms, 17.48 GB/s bus BW) and 7.4%-9.7% at M=2048..4096; GatherShards at M=8192 drops 6.2% (3.491 to 3.275 ms); Twoshot at M=8192 drops 6.6% (6.889 to 6.435 ms, 98.6% of 200 Gb/s line rate). One-shot decode latency (M=1..24) is unchanged (19.7-66.8 us). Validation and limitations: - ARM64 Linux (dgx2): cargo test --locked --release --manifest-path helios/Cargo.toml --features roce,runtime-core,server passed 1,728/1,728 (44 GPU-only ignored), including all 6 execution::roce::tests. - Paired FlashInfer validator on four GB10 Sparks: pytest tests/experimental/b12x/comm/test_roce_proxy.py passed 21/21 (including live ConnectX-7 HCA rejection of legacy 1168-byte blobs, mismatched ring_window, and mismatched ring_bytes); validate_roce_ring_native.py passed across all four ranks in both ring mode (120 iterations, --skew-rank 2 --scatter-gather) and chain mode (60 iterations, --ring-open --scatter-gather). - Live four-Spark multi-GPU serving via flare run on existing ABI-14 Inkling 2 Small NVFP4 core gb10-tp4-202611271425 (without re-export) passed short decode (60.3 tok/s), 256-token coding decode (80.6 tok/s), and 9,229-token multi-chunk cold prefill + 64-token decode (3.529 s wall) with 0/16 ConnectX-7 RDMA port errors and clean Orbit drain. - Limitations: hardware validation covers a four-node GB10 switchless ring and chain only; rings larger than four nodes were not tested on hardware, and non-ring transports are unchanged. Design-Signed-Off-By: Antigravity (Gemini-4-Neon); design-review=2e5b Signed-off-by: woooflet <ford@fordmorris.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
On a four-node 200 Gb/s
--roce-ring,RING_WINDOW = 8(512 KiB/rail) sat below the two-hop relay BDP knee andrun_pipe_opdeferreddrain_all(c)while actively posting chunks, slowing large prefill collectives. RaisingRING_WINDOWalso requires validating ring window/region sizing in the connect handshake (without bumpingROCE_ABI_VERSION = 14, so existing exported cores stay compatible) and tightening the QP send-queue reservation threshold soworld = 16still has headroom for up to 256 unreserved per-origin ACKs.This is the upstream counterpart to NVIDIA/hyperflare-inference#577 (merge this PR first so
helios/native/roce_proxy.cstays in lockstep).What Changed
flashinfer/experimental/b12x/comm/roce/_roce_proxy.c:RING_WINDOWfrom8to16(1 MiB/rail;2.008 MiB/rank in the group,8.03 MiB/rank atworld = 4).uint32_t ring_windowanduint64_t ring_bytestoroce_blob_t(sizeof(roce_blob_t)1168 -> 1176bytes, keepingROCE_ABI_VERSION = 14unchanged), populate them inroce_local_blob(0in mesh mode), and reject mismatches inroce_connect.reserve()andring_service_slot()toROCE_SEND_DEPTH / 8(64signaled ops, at most192chained WRs, leaving256WRs for unreserved per-origin ACKs atworld = 16plus64WRs of provider SQE overhead), enforced via_Static_assert.drain_all(c)insiderun_pipe_opwhenposted != 0 && c->ring != NULL. Non-ring topologies (c->ring == NULL) are unaffected.tests/experimental/b12x/comm/test_roce_proxy.py: addtest_ring_blob_handshake_rejects_window_and_size_mismatchverifyingABI_VERSION == 14,1176-byte blob sizing, legacy1168-byte blob rejection, and live-HCAroce_connectrejection of mismatchedring_windowandring_bytes.Benefit & Tests
--roce-ring(H = 4608BF16):ReduceScatter-9.7%(M = 2048),-7.4%(M = 4096),-7.1%(M = 8192,3.487 -> 3.239 ms,17.48 GB/sbus BW);GatherShardsM = 8192-6.2%;TwoshotM = 8192-6.6%(98.6%of 200 Gb/s line rate);OneshotdecodeM = 1..24unchanged (19.7–66.8 us).pytest -v tests/experimental/b12x/comm/test_roce_proxy.py:21/21passed on ARM64 GB10 (dgx2) with live ConnectX-7 HCA verification of handshake rejection.validate_roce_ring_native.pyacross 4× GB10: passed--world-size 4 --iterations 120 --skew-rank 2 --scatter-gather(ring) and--iterations 60 --ring-open --scatter-gather(chain) with0/16RDMA port errors.Caveats: Benchmarked on a four-node GB10 switchless ring and chain only; rings larger than four nodes were not tested on hardware (
world = 16send-queue headroom is enforced statically), and non-ring setups (c->ring == NULL) are unaffected.Discord: woooflet